//
// Created by liangwenhao on 2024/4/6.
//

#ifndef _LOAD_CONTROL_H
#define _LOAD_CONTROL_H
#include "motor_driver.h"
#include "pid_calculation.h"
#include "math.h"
#include "serial_servo_driver.h"

/// 同步带控制位置标志
#define Load_InitMIN 4000
#define Load_InitMAX 9000
#define LOAD_InitEXIT 100
#define LOAD_Start 20000
#define LOAD_Stage1 1100000
#define LOAD_Stage2 1216000
//122054    122507  121907

/// 发射舵机开关位置
#define FireServoClosePosition 300
#define FireServoOpenPosition 1000


extern uint8_t Load_Init_Flag;
extern uint8_t LoadMotor_AutoProcess;
extern uint8_t FiredFlag;

extern int16_t Fire_Servo_Position; // 发射舵机位置
extern float Load_CrossAngle; // 传送带转过位置

void FireServo_Control();
void LoadMotor_Init();
void LoadMotor_ShakeJudge();
void LoadMotor_Control();
void LoadMotor_AutoControl();
#endif //_LOAD_CONTROL_H
